<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>

<%
	org.scribe.model.Token EMPTY_TOKEN = null; 

org.scribe.oauth.OAuthService service = new org.scribe.builder.ServiceBuilder().provider(kr.co.redcircle.service.oAuth.api.google.Google20Api.class)
.apiKey("149480197372.apps.googleusercontent.com")
.apiSecret("XFxNGiyLVdY5F0G2iFH8g2BR")
.callback("http://broker.inpion.com/ExampleBizBrokerWASClient/YoutubeOAuth.jsp")
.scope("https://gdata.youtube.com")
.build();

org.scribe.model.Verifier verifier = new org.scribe.model.Verifier(request.getParameter("code"));
out.println();
out.println("verifier : " + verifier.toString());

// Trade the Request Token and Verfier for the Access Token
org.scribe.model.Token accessToken = service.getAccessToken(EMPTY_TOKEN, verifier);
out.println("Got the Access Token!");
out.println("(if your curious it looks like this: " + accessToken + " )");
out.println();

// Now let's go and ask for a protected resource!
System.out.println("Now we're going to access a protected resource...");
org.scribe.model.OAuthRequest req = new org.scribe.model.OAuthRequest(org.scribe.model.Verb.GET, "https://gdata.youtube.com/feeds/api/videos?q=football+-soccer&orderby=published&start-index=11&max-results=10&v=2&alt=jsonc");
service.signRequest(accessToken, req);
org.scribe.model.Response resp = req.send();
out.println(resp.getCode());
out.println(resp.getBody());
%>

</body>
</html>